<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>招标管理</title>
</head>
<body>
<script   type="text/javascript" src="../../../static/easyui/plugins/datagrid.show.js"></script>
<script   type="text/javascript" src="../../../static/js/companyInvite.js"></script>
<div class="easyui-layout" fit="true" >
    <!--west招标记录start-->
    <div data-options="region:'center',split:true,border:false" title="招标列表" style="width:70%;">
        <table id="invite_datagrid" class="easyui-datagrid"
               data-options="
		   		url:'${path}/invite/invitedg.do',
		   		fit:true,
		   		fitColumns: true,
		   		rownumbers:true,
		   		pagination:true,
		   		toolbar:'#invite_tools',
		   		singleSelect:true,
            onClickRow:function(index, row){
                rowOnchange(row.id);
            }">
            <thead>
            <th data-options="field:'id'">ID</th>
            <th data-options="field:'productId'" hidden>套餐ID</th>
            <th data-options="field:'companyName',width:150">企业名称</th>
            <th data-options="field:'productName',width:150,formatter:formatFun">套餐名称</th>
            <th data-options="field:'num'">人数</th>
            <th data-options="field:'price'">参考报价</th>
            <th data-options="field:'begin_time',width:100,formatter:formatDateBoxFull2">体检开始时间</th>
            <th data-options="field:'end_time',width:100,formatter:formatDateBoxFull2">体检结束时间</th>
            <th data-options="field:'offerbegin_time',width:100,formatter:formatDateBoxFull2">报价开始时间</th>
            <th data-options="field:'offerend_time',width:100,formatter:formatDateBoxFull2">报价结束时间</th>
            <th data-options="field:'publish_time',width:100,formatter:formatDateBoxFull2">发布时间</th>
            <th data-options="field:'status',width:50,formatter:function(value){
                if(value==0) return '招标中';if(value==1) return '撤回';return '完成'}">状态</th>
            </thead>
        </table>
        <div id="invite_tools">
            <shiro:hasPermission name="/invite/cancel.do">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo'" onclick="cancelPush()">撤销</a>
            </shiro:hasPermission>
            <input class="easyui-searchbox" data-options="prompt:'请输入企业名称',searcher:compSearch" style="width:220px;"/>
            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#invite_datagrid').datagrid('reload')">刷新</a>
        </div>
    </div>

    <!-- 详情弹层-->
    <div class="easyui-dialog" id="Detail_dialog" title="产品详情" data-options="closed:true,modal:true,width:730,height:470">
        <table id="productDetail" class="grid">
            <tr>
                <th width="100">科室</th>
                <th  width="100">项目名称</th>
                <th  width="100">明细</th>
                <th width="400">意义</th>
                <th  width="50">参考价</th>
            </tr>
        </table>
    </div>

    <!--center报价记录 start-->
    <div data-options="region:'east',split:true,border:false" title="报价记录" style="width:30%;">
        <table id="offer_datagrid" class="easyui-datagrid"
               data-options="
		   		url:'${path}/invite/offerdg.do',
		   		fit:true,
		   		rownumbers:true,
		   		fitColumns: true,
		   		pagination:true,
		   		singleSelect:true">
            <thead>
            <th data-options="field:'id'">ID</th>
            <th data-options="field:'seller_id'" hidden>机构ID</th>
            <th data-options="field:'name',width:200">机构名称</th>
            <th data-options="field:'invite_id'" >招标ID</th>
            <th data-options="field:'price',width:100">报价</th>
            <th data-options="field:'offer_time',width:200,formatter:formatDateBoxFull2">报价时间</th>
            <th data-options="field:'status',width:100,formatter:
            function(value){if(value==0) return '待确认';
                if(value==1) return '撤销';
                if(value==2) return '确认';
                return '拒绝'}">状态</th>
            </thead>
            <div id="offer_tools">
                <shiro:hasPermission name="/invite/revert.do">
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo'" onclick="cancelOffer()">撤销</a>
                </shiro:hasPermission>
                <shiro:hasPermission name="/invite/affirm.do">
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="okOffer()">确认</a>
                </shiro:hasPermission>
            </div>
        </table>
    </div>
</div>
</body>
</html>
